package com.作业.Day4;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public class Customer {
    //属性
    int  score;
    String card;
     void show(){
         System.out.println("显示积分"+score+"卡类型"+card);
     }
    /**
     * 积分回馈功能
     */
    public void back(){
       if(card.equals("金卡")){
           if(score>1000){
               System.out.println("回馈积分500！");

           }
           else
               System.out.println("尊敬的金卡会员，您积分不够无法会回馈");
       }
       else if(card.equals("普卡")){
           if(score>5000){
               System.out.println("回馈积分500！");
           }
           else
               System.out.println("尊敬的普卡会员，您积分不够无法会回馈");
       }
       else
           System.out.println("您积分不够无法会回馈");
    }

    @Override
    public String toString() {
        return "Customer{" +
                "score=" + score +
                ", card='" + card + '\'' +
                '}';
    }
}
